#pragma once

#include "RHITexture.h"

enum RenderTargetType
{
	Color = 0,
	Resolve = 1,
	Depth = 2
};

//#####################################################################################
// 
// if you want to make renderTarget be other renderPass sampler, do :
// set finalLayout to VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL or tranfer by youself
// set storeOp to VK_ATTACHMENT_STORE_OP_STORE
// create the render target with usage VK_IMAGE_USAGE_SAMPLED_BIT
// the pipeline and render pass should add stage and access mask like this : 
// 
// dependencies[0].srcStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
// dependencies[0].dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
// dependencies[0].srcAccessMask = VK_ACCESS_SHADER_READ_BIT;
// dependencies[0].dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
// 
// dependencies[1].srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
// dependencies[1].dstStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
// dependencies[1].srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
// dependencies[1].dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
// 
//#####################################################################################

class RenderTarget : public RHITexture
{
public:

	RenderTargetType GetRenderTargetType() const;

	VkAttachmentDescription GetAttachmentDescription() const;

	VkClearValue GetClearValue() const;

	void ResetLoadOp(VkAttachmentLoadOp loadOp);

	void ResetStoreOp(VkAttachmentStoreOp storeOp);

protected:

	RenderTargetType mRenderTargetType;

	VkAttachmentDescription mAttachmentDescription;

	VkClearValue mClearValue;
};